Change DOORS requirement level with DXL

I want to run a DXL script to change the current level (object number/object level) of a requirement. I want to check for object heading matching "xxx". If the requirement heading matches "xxx" then I want to check if the object level is 3 then change it to 4 i.e. move to one object below.

Please help me out.
SumitKumarApata - Mon May 30 08:32:20 EDT 2011

Re: Change DOORS requirement level with DXL
Mathias Mamsch - Mon May 30 09:07:53 EDT 2011

Use the 'setLevel' function from this post, then make a script like this:
 

Object o
for o in entire current Module do {
   if (isDeleted o || cell o || row o || table o) continue
   if (o."Object Heading" "" == "xxx" && level o == 3) setLevel(o, 4) 
}

 


Did not test this script, but I guess you can figure the rest for yourself? Hope this helps, Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Change DOORS requirement level with DXL
SumitKumarApata - Mon May 30 09:31:46 EDT 2011

Mathias Mamsch - Mon May 30 09:07:53 EDT 2011

Use the 'setLevel' function from this post, then make a script like this:
 

Object o
for o in entire current Module do {
   if (isDeleted o || cell o || row o || table o) continue
   if (o."Object Heading" "" == "xxx" && level o == 3) setLevel(o, 4) 
}

 


Did not test this script, but I guess you can figure the rest for yourself? Hope this helps, Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Tried doing this:
Module m = current
Object o

for o in m do
{
int lvl = o."Object Depth"
setLevel(o, lvl)
}

"Object Depth" is the column which has the actual level that need to be maintained. It's a user defined attribute.

But getting the below error:
-E- DXL: <Line:7> incorrectly concatenated tokens
-E- DXL: <Line:7> undeclared variable (setLevel)
-I- DXL: All done. Errors reported: 2. Warnings reported: 0.

Re: Change DOORS requirement level with DXL
Mathias Mamsch - Mon May 30 09:40:28 EDT 2011

SumitKumarApata - Mon May 30 09:31:46 EDT 2011
Tried doing this:
Module m = current
Object o

for o in m do
{
int lvl = o."Object Depth"
setLevel(o, lvl)
}

"Object Depth" is the column which has the actual level that need to be maintained. It's a user defined attribute.

But getting the below error:
-E- DXL: <Line:7> incorrectly concatenated tokens
-E- DXL: <Line:7> undeclared variable (setLevel)
-I- DXL: All done. Errors reported: 2. Warnings reported: 0.

See here for the setLevel function:

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14616045&#14616045

If you view the post from the web, then you will have an hyperlink in the post. I just learned that when you get notification emails, that hyperlinks will be transferred to plaintext, so that is probably the reason why you did not find the setlevel function.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Change DOORS requirement level with DXL
SumitKumarApata - Tue May 31 21:42:40 EDT 2011

Mathias Mamsch - Mon May 30 09:40:28 EDT 2011
See here for the setLevel function:

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14616045&#14616045

If you view the post from the web, then you will have an hyperlink in the post. I just learned that when you get notification emails, that hyperlinks will be transferred to plaintext, so that is probably the reason why you did not find the setlevel function.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Thanks Mathias Mamsch for your help. Well I had few other complications in my requirement therefore couldn't finally use the above, but now I got my issue resolved with another DXL script to actually arrange requirements based on the object number (1.1.2 etc.) that I specify.
Thanks for your help and tips anyway.